package cn.maihe.elg.operation.supports.electronicseal.kt.cloudsign.enums;

import java.util.Arrays;

/**
 * @Description
 * @Author WJH
 * @Date 2022/09/27
 */
public enum KtCertState {
    NOT_EXISTS(0,"找不到数据"),
    CERT_MAKING(1,"待制证"),
    SEAL_MAKING(2,"已制证未制章"),
    SEAL_OK(3,"证章制作成功"),
    ;
    /**
     * 证书状态 0是找不到数据，1是待制证，2是已制证未制章，3是证章制作成功
     */
    private Integer certState;
    private String desc;

    KtCertState(Integer certState, String desc) {
        this.certState = certState;
        this.desc = desc;
    }

    public Integer getCertState() {
        return certState;
    }

    public String getDesc() {
        return desc;
    }

    public static KtCertState resolve(Integer certState){
        if(certState==null){return null;}
        return Arrays.stream(values()).filter(o -> o.certState.intValue() == certState).findFirst().orElseGet(null);
    }
}
